package edu.spec.wfl.week08.class2.book.unit4.there;

public class Student extends Person {

    private String no;
    private double scoreOfEn;
    private double scoreOfMath;
    private double scoreOfCh;

    public double aver(){
        return (scoreOfEn + scoreOfMath + scoreOfCh)/3;
    }

    public double max(){
        if(scoreOfEn >= scoreOfMath && scoreOfEn >= scoreOfCh){
            System.out.println("scoreOfEn:" + scoreOfEn);
            return scoreOfEn;
        }

        if(scoreOfMath >= scoreOfEn && scoreOfMath >= scoreOfCh){
            System.out.println("scoreOfMath:" + scoreOfMath);
            return scoreOfEn;
        }

        if(scoreOfCh >= scoreOfMath && scoreOfCh >= scoreOfEn){
            System.out.println("scoreOfCh:" + scoreOfCh);
            return scoreOfCh;
        }
        return 0;
    }
}
